Skip to content

fix(auth): prevent open redirect and log injection in feedback handlers - #28

Open
cziegeler wants to merge 1 commit into
masterfrom
maia/workflow-1784198327114
Open

fix(auth): prevent open redirect and log injection in feedback handlers#28
cziegeler wants to merge 1 commit into
masterfrom
maia/workflow-1784198327114

Conversation

@cziegeler

Copy link
Copy Markdown
Contributor

Hardens the redirect handling in both DefaultAuthenticationFeedbackHandler and DefaultJakartaAuthenticationFeedbackHandler against open-redirect attacks and log-injection vulnerabilities.

Changes:

  • Restrict sendRedirect to relative paths only (must start with / and not contain ://); falls back to / for any external or protocol-relative URL
  • Add sanitizeForLog() helper that escapes CR (\r) and LF (\n) characters to prevent log injection
  • Apply sanitizeForLog() to all redirect-target values before passing them to logger calls
  • Switch error log concatenation to SLF4J parameterized logging ({} placeholder) for consistency and safety

Co-authored-by: Maia maia@noreply

@cziegeler cziegeler added the risk/medium Maia risk level label Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk/medium Maia risk level

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant